﻿using ScreenCapture.Base.Services;
using ScreenCapture.Windows.MediaFoundation;
using System;

namespace ScreenCapture.Windows.Models
{
    public static class WindowsModule
    {
        public static void Load(IBinder MyBinder)
        {
            if (Window8OrAbove)
            {
                MfManager.Startup();
            }

            MyBinder.Bind<IClipboardService, ClipboardService>();

        }

        public static bool Window8OrAbove
        {
            get
            {
                // All Versions above Windows 8 give the same version number
                // win8 以上版本返回的版本号都是(6,2,9200,0),所以可以根据是否大于等于这个版本号去确认是否是win8系统
                var version = new Version(6, 2, 9200, 0);
                return Environment.OSVersion.Platform == PlatformID.Win32NT && Environment.OSVersion.Version >= version;
            }
        }

    }
}
